package com.yr.ryjk.businessengine.task;

import java.io.Serializable;

/**
 * 任务的基础类,可继承扩展此类
 * @author Rick
 * 
 */
public class BaseTask implements Serializable {
	private static final long serialVersionUID = 1L;
	// key to store
	protected String storename = null;
	
	// set whether to store in persistent, default is true
	protected boolean isNeedPersistent = true;
		
	public boolean getIsNeedPersistent(){
		return isNeedPersistent;
	}


	public BaseTask() {
		storename = this.getClass().getName() + System.currentTimeMillis();
	}

	@Override
	public int hashCode() {
		return 1;
	}

	@Override
	public boolean equals(Object other) {
		BaseTask task = (BaseTask) other;
		return this.storename.equalsIgnoreCase(task.storename);
	}

	public String getStoreName() {
		return storename;
	}

	/**
	 * 获取下个任务
	 * 
	 * @return
	 */
	public BaseTask getNext() {
		return null;
	}

	/**
	 * 具体的业务逻辑
	 * @throws Exception 
	 */
	public void exec(){

	}
}